package gui_;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class Gui extends JFrame{
	private JComboBox box;
	private JButton submit;
	private JLabel label1;
	private String[] identity = {"professor", "student", "assistant", "admenistrator"};
	public Gui(){
		super("plese identify yourself");
		setLayout(new FlowLayout());
		
		box = new JComboBox(identity);
		submit = new JButton("submit");
		add(box);
		add(submit);
		HandlerClass handler = new HandlerClass();
		submit.addActionListener(handler);
		
		
	}
	private class HandlerClass implements ActionListener{
		public void actionPerformed(ActionEvent event){
			JOptionPane.showInputDialog(submit, "your name", event.getActionCommand(), JFrame.EXIT_ON_CLOSE);
		}

			}
	public static void main(String[] args) {
		Gui go = new Gui();
		go.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		go.setSize(500, 200);
		go.setVisible(true);
	}
}
